home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / FORTH / FORTHMAC / OLD / DOCS / !Forthmacs.docs.ascii.typing < prev    next >
Encoding:
Text File  |  1996-06-15  |  6.3 KB  |  182 lines

  1.  
  2. Typing Forth Command Lines
  3. **************************
  4.  
  5. This chapter describes the editing facilities that are available when 
  6. you are typing command lines to RISC OS Forthmacs.  These facilities 
  7. are much more powerful than those of most other systems.  Study this 
  8. carefully, and it will save you a great deal of typing in the future.  
  9.  
  10.  
  11.     Quick Reference Chart:
  12.         Moving:         Character       Word            Line
  13.             backward:   left-arrow      ESC-b           ^A
  14.                         or ^B   
  15.             forward:    right-arrow     ESC-f           ^E
  16.                         or ^F
  17.         Erasing:        Character       Word            Line
  18.  
  19.             backward:   ^H              ESC-h   
  20.                         or Backspace    or ^W   
  21.             forward:    ^D              ESC-d           ^K
  22.                         or Delete
  23.             entire line:                                ^U
  24.  
  25.         Others:
  26.             previous command            up-arrow  or  ^P
  27.             next command                down-arrow  or  ^N
  28.  
  29.             complete word               ^C
  30.             show matches                ^S
  31.  
  32.             retype line                 ^L
  33.             quote next character        ^Q
  34.  
  35.  
  36. Typing Forth Command Lines
  37. ==========================
  38.  
  39.  
  40. Notation
  41. ========
  42.  
  43.   ^B      hold down the Control key and simultaneously type the b key.
  44.   ESC-b   first type the Esc key, release it, and then type the b key.
  45.   ^X^C    first press ^X, release it, and then press ^C
  46.  
  47. Note that for Control, two keys are typed at the same time, whereas 
  48. for Esc, the Esc key is first typed and released, then the other key 
  49. is typed.  
  50.  
  51.  
  52. Moving
  53. ======
  54.  
  55.   left-arrow   or  ^B     Backs up one character without erasing
  56.   right-arrow  or  ^F     Moves forward one character without erasing
  57.   ESC-b                   Backs up one word without erasing
  58.   ESC-f                   Moves forward one word without erasing
  59.   ^A                      Moves to the beginning of the line
  60.   ^E                      Moves to the end of the line
  61.  
  62.  
  63. Erasing
  64. =======
  65.  
  66.   Backspace or ^H         Erases character to the left of the cursor
  67.   Delete or ^D            Erases character at the cursor
  68.   ESC-h                   Erases the word to the left of the cursor
  69.   ESC-d                   Erases the word to the right of the cursor
  70.   ^K                      Erases from the cursor to the end of the line
  71.  
  72.  
  73. History
  74. =======
  75.  
  76. RISC OS Forthmacs remembers the last 8 lines you typed, so you can 
  77. easily 
  78.  
  79.   repeat or modify previously-typed commands.
  80.   up-arrow    or ^P       Steps backward through the list of
  81.                           previous commands.
  82.   down-arrow  or ^N       Steps forward through the list of
  83.                           previous commands.
  84.  
  85.  
  86. Command Completion
  87. ==================
  88.  
  89. When you are typing a Forth word, it is not always necessary to type 
  90. the whole word.  If you type the first few characters of the word, 
  91. then type ^C (i.e.  hold down the Control key and type the C), Forth 
  92. will try to finish the word for you by looking in its dictionary for 
  93. words which start with the characters you have typed.  If there is 
  94. only one possible word, Forth will complete the word for you.  
  95.  
  96. Sometimes Forth will be unable to finish the word.  If there are no 
  97. words in the Forth dictionary which start with the characters you have 
  98. already typed, Forth will remove characters from the end until the 
  99. characters that are left start some word in the dictionary.  If there 
  100. are several words which start with your characters, Forth will 
  101. complete the word as far as it can.  In either case, you can then type 
  102. some more characters to further specify the desired word, then try ^C 
  103. again.  
  104.  
  105.   ^C            Forth attempts to complete the word you have started
  106.   ^S            Shows a list of all the words which start with the
  107.                 characters you have typed.
  108.  
  109.  
  110. Miscellaneous
  111. =============
  112.  
  113.   ^L              Retypes the current line.
  114.   ^Q              The next character typed (usually a control
  115.                   character) is inserted into the line being typed,
  116.                   instead of being treated as an editing command.
  117.  
  118.   ^X^C            Quit Forthmacs at once
  119.  
  120.  
  121. Mnemonics
  122. =========
  123.  
  124. To make it easier to remember the control commands, here are some 
  125. mnemonics: 
  126.  
  127.   ^F   ESC-f      Forward character or word
  128.   ^B   ESC-b      Backward character or word
  129.   ^E              End of line
  130.   ^D   ESC-d      Delete character or word
  131.   ^K              Kill rest of line
  132.   ^P              Previous line
  133.   ^N              Next line
  134.   ^Q              Quote next character
  135.  
  136.  
  137. Tips
  138. ====
  139.  
  140. To delete the entire line, type ^A followed by ^K.  It is not 
  141. necessary to release the Control key between the typing of the A and 
  142. the typing of the K.  
  143.  
  144. Practice using the history mechanism (^P and ^N).  Forth commands are 
  145. frequently repeated, and the history feature can save you much typing.  
  146.  
  147. The "show matches" command (^S) can be used to find all the Forth 
  148. words which start with a particular string of characters.  Just type 
  149. that string of characters then type ^S.  (There is a Forth command 
  150. SIFTING that will find all the words which contain a particular string 
  151. anywhere in the name, not just at the start as in ^S.  SIFTING is 
  152. described in the master glossary.  
  153.  
  154. Try to train your fingers to type ^F, ^B, ^A, ^E, and ^D without using 
  155. your right hand.  This can make editing very fast because you don't 
  156. have to move your hands very far, and it is relatively easy to type 
  157. these combinations without looking at your fingers.  
  158.  
  159. Why do many functions have two different key assignments? Some people 
  160. prefer to use the arrow keys because they are easier to remember.  
  161. Others prefer to use the ^ keys because they can be typed without 
  162. moving the hands from the home keys on the keyboard.  
  163.  
  164.  
  165.  
  166.  
  167. For Experts
  168. ===========
  169.  
  170. If you do not like the assignment of functions to keys (for instance 
  171. you might prefer to use ^S and ^D to move forward and backward, as in 
  172. Wordstar), you can easily change the assignments.  The vocabulary 
  173. KEYS-FORTH contains a colon definition or alias for each key 
  174. assignment.  These assignments may be redefined using normal colon 
  175. definitions.  
  176.  
  177. However, note that the existing key assignments are the same as the 
  178. ones in the Emacs editor.  The Emacs key assignments cannot be easily 
  179. changed, so if you change the assignments in KEYS-FORTH you will make 
  180. them different from the ones in Emacs.  
  181.  
  182.